import request from '@/utils/request'

// 获取文章列表
export function getArticleList(params) {
  return request({
    url: '/api/article/list',
    method: 'get',
    params
  })
}

// 获取文章详情
export function getArticleDetail(id) {
  return request({
    url: `/api/article/${id}`,
    method: 'get'
  })
}

// 获取推荐文章
export function getRecommendArticles(limit = 5) {
  return request({
    url: '/api/article/recommend',
    method: 'get',
    params: { limit }
  })
}

// 获取文章分类
export function getArticleCategories() {
  return request({
    url: '/api/article/category/list',
    method: 'get'
  })
}
